﻿package com.webbei.HAO.action;

import java.util.HashMap;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.webbei.HAO.service.ChSer;
/**
 * 添加第三方绑定类
 * @author xingxing
 *
 */
public class AddThirdPartyJson {
	private String thirdpartyId;
	private String thirdTypeId;
	private String msg;
    private ChSer ser;
    public String execute(){
    	String username = (String) ServletActionContext.getContext().getSession().get("username");
    	Map<String,String> map=new HashMap<String,String>();
		map.put("thirdId", thirdpartyId);
		map.put("thirdTypeId", thirdTypeId);
		map.put("username", username);
		System.out.println(map+"------map");
		int i = ser.insertThirdParty(map);
		if(i==1){
			msg="success";
			ServletActionContext.getRequest().getSession().removeAttribute("thirdTypeId");
			ServletActionContext.getRequest().getSession().removeAttribute("imgSrc");
			ServletActionContext.getRequest().getSession().removeAttribute("screenName");
		}
    	return "success";
    }
	public String getThirdpartyId() {
		return thirdpartyId;
	}
	public void setThirdpartyId(String thirdpartyId) {
		this.thirdpartyId = thirdpartyId;
	}
	public String getThirdTypeId() {
		return thirdTypeId;
	}
	public void setThirdTypeId(String thirdTypeId) {
		this.thirdTypeId = thirdTypeId;
	}
	public void setSer(ChSer ser) {
		this.ser = ser;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}

}
